[bl0942] Update references #5853
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR updates the BL0942 reference calibration values (voltage, current, power, and energy) to match values derived from the BL0940 Application Note formulas combined with BL0942 datasheet constants.
The updated reference values are calculated for the most commonly used hardware configuration:
Why is this needed?
With the existing reference values, the BL0942 energy measurement consistently reports higher accumulated energy than expected. This becomes apparent when comparing:
energysensortotal_daily_energysensorIn real-world usage,
total_daily_energywas consistently lower than the accumulated energy reported by the BL0942 component, indicating incorrect energy scaling.What is the result?
After applying the corrected reference values:
energysensor andtotal_daily_energyare consistent with each otherScope and compatibility
These reference values are explicitly intended for the most common BL0942 hardware design. Custom hardware with different shunt values or voltage dividers may still require custom calibration.
Related issue (if applicable): fixes
Pull request in esphome with YAML changes (if applicable):
Checklist:
I am merging into
nextbecause this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
currentbecause this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/components/_index.mdwhen creating new documents for new components or cookbook.New Component Images
If you are adding a new component to ESPHome, you can automatically generate a standardized black and white component name image for the documentation.
To generate a component image:
Comment on this pull request with the following command, replacing
component_namewith your component name in lower_case format with underscores (e.g.,bme280,sht3x,dallas_temp):The ESPHome bot will respond with a downloadable ZIP file containing the SVG image.
Extract the SVG file and place it in the
/static/images/folder of this repository.Use the image in your component's index table entry in
/components/_index.md.Example: For a component called "DHT22 Temperature Sensor", use: